package com.xkdx.guangguang.fragment.user;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.UUID;

import android.util.Log;

import com.xkdx.guangguang.module.network.AbsAction;
import com.xkdx.guangguang.module.statics.IConstants;

public class UserQuickRegistAction extends AbsAction {

	// String json = UserLoginFragment.quickJson;
	String deviceSN, deviceModel, oSVersion, mobilePhone;

	public UserQuickRegistAction(String deviceSN, String deviceModel,
			String oSVersion, String mobilePhone) {
		url = IConstants.addressV2;
		this.deviceSN = deviceSN;
		this.deviceModel = deviceModel;
		this.oSVersion = oSVersion;
		this.mobilePhone = mobilePhone;
	}

	@Override
	public void constructRequest() {
		HashMap<String, String> map = new HashMap<String, String>();

		map.put("LoginID", deviceSN);
		map.put("DeviceID", "2");
		map.put("RegionID", "D0101");
		map.put("Password", "123456");
		map.put("NickName", deviceSN);
		map.put("MobilePhone", mobilePhone);
		map.put("DeviceSN", deviceSN);
		map.put("DeviceModel", deviceModel);
		map.put("OSVersion", oSVersion);

		String registJson = constructJson(map);
		Parameter parameter = new Parameter("userInterface", "register",
				registJson);

		HashMap<String, String> loginmap = new HashMap<String, String>();
		
		loginmap.put("LoginID", deviceSN);
		loginmap.put("DeviceID", "2");
		loginmap.put("RegionID", "D0101");
		loginmap.put("Password", "123456");
		loginmap.put("DeviceSN", deviceSN);
		loginmap.put("DeviceModel", deviceModel);
		loginmap.put("OSVersion", oSVersion);

		String loginJson = constructJson(loginmap);

		Parameter parameter2 = new Parameter("userInterface", "login",
				loginJson);
		List<Parameter> list = new ArrayList<Parameter>();
		list.add(parameter);
		list.add(parameter2);
		
		requestData = constructMod(list);
	}
}
